/**
 * @file
 * @author Filipe Mutz
 *
 * @section DESCRIPTION
 *
 * This file contains generic utility functions
 */

#include "util.h"

double
calculate_hamming_distance(vector<int> a, vector<int> b)
{
	int i;
	double hamming_dist = 0;

	if (a.size() != b.size())
		exit(printf("Error: Trying to calculate hamming distance between two vectors with different size\n"));

	for(i = 0; i < (int) a.size(); i++)
		hamming_dist += (a[i] ^ b[i]);

	return hamming_dist;
}
